using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using ValidationFramework.Reflection;
using System.Linq;

namespace ValidationFramework
{
    public class AppDesciber : IApplicationDesciber
    {
        public IEnumerable<Type> GetAllChildTypes(Type targetType)
        {
            var list = new List<Type>();

            // TODO: We probably shouldn't be scanning all assemblies.
            var assemblies = AppDomain.CurrentDomain.GetAssemblies();
            foreach (var assembly in assemblies)
            {
                list.AddRange(assembly.GetTypes().Where(type => type.IsSubclassOf(targetType)));
            }

            return list;
        }


        public AppDesciber()
        {
        }


    }
}
